import { getAppInfo } from '@/store';
import { createVueElement } from '../../helper/creater';
import TabNav from './TabNav.vue';

export const getTabNavs = () => getAppInfo('tabNavs').map((tabNav) => {
    tabNav.isCurrentPage = tabNav.name === window.PAGE_NAME;
    return tabNav;
});

export const createTabNav = () => {
    return createVueElement(TabNav, {
        tabNavs: getTabNavs()
    }).el;
}

export { TabNav };